<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition template="../default/template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:consult="http://www.consult.com.br/jsf/consultutils"
	xmlns:web="http://www.web.com.br/jsf/webutils">

	<ui:define name="contentConsult">

		<fieldset id="fieldsetCampos" style="padding: 10px;">

			<legend style="font-weight: bold; font-size: 16px; width: auto;">#{messages['global.cadastrar.fieldset']}</legend>

			<h:panelGrid columns="2">

				<web:outputTextField id="labelCodigo"
					value="#{messages['label.codigo']}:" required="true" width="120px"
					align="right" />

				<web:fieldInputText id="inputCodigo" required="true" width="120px"
					value="#{naturezaInclusaoUI.bean.id}" readonly="true" />


			</h:panelGrid>

			<h:panelGrid columns="3">

				<web:outputTextField id="labelDescricao"
					value="#{messages['label.descricao']}:" required="true"
					width="120px" align="right" />

				<web:fieldInputText id="inputDescricao" required="true"
					width="360px" value="#{naturezaInclusaoUI.bean.descricao}" 
					readonly="#{naturezaInclusaoUI.isViewing()}" />

				<p:message for="inputDescricaoText" id="inputDescricao_message"
					display="text" redisplay="true" />

			</h:panelGrid>

		</fieldset>

		<fieldset id="fieldsetOpcoes" style="padding: 10px">

			<legend style="font-weight: bold; font-size: 16px; width: auto;">#{messages['global.opcoes.fieldset']}</legend>

			<h:panelGrid columns="2">

				<web:outputTextField id="btnIncluirLabel" value=".:"
					required="false" width="120px" align="right" />

				<web:field for="btnIncluir" mode="1" required="false"
					addMessage="false">

					<p:commandButton id="btnIncluir"
						rendered="#{not naturezaInclusaoUI.isViewing()}"
						value="#{(naturezaInclusaoUI.isInserting()) ? messages['global.msg.incluir'] : messages['global.msg.atualizar']}"
						update="@form" action="#{naturezaInclusaoUI.save}" ajax="true"
						icon="#{messages['global.operations.save.icon']}" process="@form"
						style="margin-right: 5px;" />

					<p:commandButton id="btnReset"
						rendered="#{not naturezaInclusaoUI.isViewing()}"
						value="#{messages['global.msg.reset']}" update="@form"
						icon="#{messages['global.operations.reset.icon']}"
						process="@this" style="margin-right: 5px;" immediate="true" />
					<!-- action="#{(naturezaInclusaoUI.isInserting) ? naturezaInclusaoUI.prepareCreate : naturezaInclusaoUI.prepareEdit}"  -->


					<p:commandButton id="btnVoltar"
						value="#{messages['global.msg.voltar']}" update="@form"
						action="#{naturezaInclusaoUI.prepareSearch}" ajax="true"
						icon="#{messages['global.operations.back.icon']}" process="@this"
						style="margin-right: 5px;" />

				</web:field>

			</h:panelGrid>

		</fieldset>

	</ui:define>

</ui:composition>